package cp3120.dao;

import cp3120.model.Permission;
import cp3120.model.Role;
import cp3120.model.User;
import java.util.List;

/**
 *
 * @author Adam Scarr <scarr.adam@gmail.com>
 */
public interface UserDAO {
    /**
     * gets a user by username
     * @param username the username of teh user to be retreived
     * @return the user
     */
    public User getUser(String username);

    /**
     * gets a list of all users
     * @return a lsit of users
     */
    public List<User> getUsers();

    /**
     * updates a user
     * @param user the updated user
     * @return true if updated
     */
    public boolean updateUser(User user);

    /**
     * adds a user
     * @param user the new user to be added
     * @return true if added
     */
    public boolean addUser(User user);

    /**
     * deletes a user
     * @param user the user to be deleted
     * @return true if deleted
     */
    public boolean deleteUser(User user);

    /**
     * gets a lsit of all roles
     * @return a lsit of roles
     */
    public List<Role> getRoles();

    /**
     * updates a role
     * @param role the updated role
     * @return true if updated
     */
    public boolean updateRole(Role role);

    /**
     * deletes a role
     * @param role the role to delete
     * @return true if deleted
     */
    public boolean deleteRole(Role role);

    /**
     * adds a role
     * @param role the new role to be added
     * @return true if added
     */
    public boolean addRole(Role role);

    /**
     * gets a list of all permissions
     * @return a lsit of permissions
     */
    public List<Permission> getPermissions();

}
